//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;

namespace OpenLS.Spreadsheet
{
    class DifferentialStyleRecordResolver
    {
        public DifferentialStyleRecordResolver(int offset)
        {
            this.offset = offset;
        }
        public void Initialize (List<DifferentialStyleRecord> records)
        {
            _records = records;
        }

        private List<DifferentialStyleRecord> _records;
        private readonly int offset;

        public DifferentialStyleRecordResolver(List<DifferentialStyleRecord> dxfs, int offset): this(offset)
        {
            Initialize(dxfs);
        }

        public DifferentialStyleRecord this [int i]
        {
            get
            {
                int index = i - offset;
                if (index < 0)
                    return null;
                return _records[index];
            }
        }
    }
}
